<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2012-1-15
  Time: 11:28:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/inc/taglibs.jsp"%>

<form id="searchForm" method="post" action="${path }/admin/ticket">
	<input type="hidden" name="status" value="${param.status}"/>
	<input type="hidden" name="keywords" value="${param.keywords}" />
	<input type="hidden" name="pageNum" value="${pageTurn.page }" />
	<input type="hidden" name="numPerPage" value="${pageTurn.pageSize }" />
	<input type="hidden" name="orderField" value="" />
	<input type="hidden" name="rel" value="${rel }"/>
</form>
<form rel="searchForm" class="pageForm" onsubmit="return navTabSearch(this);" action="${path }/admin/ticket?rel=${rel}" method="post">
	<div class="searchBar">
		<table>
              <tr>
                  <td>
                      航空公司
                  </td>
                  <td>
                       <select id="airlinecomp" name="airlinecomp">
                            <option value="-1">-请选择--</option>
                       </select>
                  </td>
                  <td>
                      日期:
                  </td>
                  <td>
                      <input class="date" format="yyyy-MM-dd" type="text" name="takeofftime" value="${takeofftime}">
                  </td>
                  <td>
                      起飞地
                  </td>
                  <td>
                      <input name="fromarea" id="from" type="text" value="${fromarea}"/>
                  </td>
                  
                  <td>
                      目的地
                  </td>
                  <td>
                      <input name="desarea" id="des" type="text" value="${desarea}"/>

                  </td>
              </tr>
		</table>

		<div class="subBar">
			<ul>
				<li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>
			</ul>
		</div>
	</div>
	</form>

<div class="pageContent" style="border-left:1px #B8D0D6 solid;border-right:1px #B8D0D6 solid">
	<div class="panelBar">
			<ul class="toolBar">
				<c:choose>
					<c:when test="${!empty isLookup }">
						<li><div class="button"><div class="buttonContent"><button type="button" multLookup="idarry" warn="请选择">选择带回</button></div></div></li>
					</c:when>
					<c:otherwise>
						<li><a class="add" href="${path}/admin/ticket/edit" target="dialog" rel="ticketEdit"  title="添加机票" width="700" height="600"><span>添加</span></a></li>
						<li><a class="delete" href="${path}/admin/ticket/del?rel=${rel}" target="selectedTodo" rel="ids" title="确定删除所选记录?"><span>删除</span></a></li>
					</c:otherwise>
				</c:choose>

			</ul>
	</div>
	<table class="list" width="99%" layoutH="100">
		<thead>
			<tr>
				<th width="30px">选择</th>
				<th width="100px">航空公司</th>
                <th width="100px">型号</th>
                <th width="120px">起飞时间</th>
                <th width="100px">起飞地</th>
                <th width="100px">目的地</th>
                <th width="100px">机场</th>
                <th width="80px">价格</th>
                <th width="80px">数量</th>
				<th width="100px">操作</th>
			</tr>
		</thead>
		<tbody>
			<c:forEach items="${page.result }" var="item">
				<tr>
					<td>
						<c:choose>
							<c:when test="${!empty isLookup }">
								<input name="ids" value="{id:'${item.id}',name:'${item.name }'}" type="checkbox">
							</c:when>
							<c:otherwise>
								<input name="ids" value="${item.id }" type="checkbox">
							</c:otherwise>
						</c:choose>

					</td>

					<td>
						${item.airlinecompName}
					</td>
                    <td>
						${item.airlinemodel}
					</td>
                    <td>
                        <fmt:formatDate value="${item.takeofftime}" pattern="yyyy-MM-dd HH:mm"/> 
					</td>
                    <td>
						${item.fromareaName}
					</td>
                    <td>
						${item.desareaName}
					</td>
                    <td>
						${item.airportName}
					</td>
                    <td>
						${item.price}
					</td>
                    <td>
						${item.totalcount}
					</td>
					<c:if test="${empty isLookup }">
					<td>
						<a class="btnEdit" title="编辑" target="dialog" href="${path}/admin/ticket/edit?id=${item.id}&rel=${rel}" rel="${rel }" width="700" height="600"><span>修改</span></a>
					</td>
					</c:if>
				</tr>
			</c:forEach>
		</tbody>
	</table>
	<div class="panelBar">
		<%@ include file="/inc/admin-page.jsp"%>
	</div>
</div>
<script type="text/javascript" src="${path}/js/admin/ticket.js"></script>
<script type="text/javascript">

    $(document).ready(function(){
        var props = {
            basePath:'${path}',
            modelAirLineComp:'${airlinecomp}'
        }
        var t = new ticket(props);
        t.rendAirLineCompHome();
    });
</script>